<div class="users index">
<?php
    if($this->Session->read('login')=='yes')
    { ?>
	<h2><?php echo __('User Management'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
	<!--not shown to user
			<th><?php echo $this->Paginator->sort('User ID'); ?></th>
	-->
			<th><?php echo $this->Paginator->sort('User Name'); ?></th>
			<th><?php echo $this->Paginator->sort('First Name'); ?></th>
			<th><?php echo $this->Paginator->sort('Last Name'); ?></th>

	</tr>
	<?php foreach ($users as $user): ?>
	<tr>
	<!--not shown to user
		<td><?php echo h($user['User']['UserID']); ?>&nbsp;</td>
	-->
		<td><?php echo h($user['User']['UserName']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['FirstName']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['LastName']); ?>&nbsp;</td>
	
	<div id="mybuttons">
	<td class="myButtons">
	    <?php
            if($this->Session->read('login')=='yes')
            {
                echo $this->Html->image("view-btn.jpg", array( "alt" => "View", 'url' => array('action' => 'view', $user['User']['UserID']))); 
				echo $this->Html->image("edit-btn.jpg", array( "alt" => "Edit", 'url' => array('action' => 'edit', $user['User']['UserID']) ));
				echo $this->Form->postLink($this->Html->image("delete-btn.jpg", array('alt' => __('Delete'))), array('action' => 'delete', $user['User']['UserID']), array('escape' => false), __('Are you sure you want to delete #%s?', $user['User']['UserID']));
            }
            ?>
			
		</td>
		</div>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>
	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>

	<?php echo $this->Html->link(__('Add New User'), array('action' => 'add')); ?>
</div>

<?php
}else
{
    ?>
    <p>You can't view the content in this page</p>
<?php
}
?>
